package javaCode;

import java.util.List;

/**
 * Created by lxy_920912 on 24/04/2017.
 */
public class ListNode {
    int val;
    ListNode next;
    ListNode(int x) { val = x; }
    public ListNode build(int[] nums, ListNode head){
        head = new ListNode(nums[0]);
        ListNode q = head;
        for(int i = 1;i < nums[i];i++){
            ListNode p = new ListNode(nums[i]);
            q.next = p;
            q = p;
        }
        return head;
    }
}
